object DMdl: TDMdl
  OldCreateOrder = False
  OnCreate = DataModuleCreate
  Left = 320
  Top = 274
  Height = 594
  Width = 936
  object dmConnection: TUniConnection
    ProviderName = 'MySQL'
    Port = 3306
    SpecificOptions.Strings = (
      'MySQL.Charset=cp1251')
    Username = 'root'
    Password = '1111'
    Server = 'localhost'
    LoginPrompt = False
    Left = 32
    Top = 16
  end
  object MySQLUniProvider1: TMySQLUniProvider
    Left = 56
    Top = 80
  end
  object tdlUserState: TUniTable
    TableName = 'crm_user_state'
    Connection = dmConnection
    Left = 232
    Top = 16
  end
  object dsUserState: TDataSource
    DataSet = tdlUserState
    Left = 240
    Top = 32
  end
  object tblJobTitle: TUniTable
    TableName = 'dic_job_title'
    Connection = dmConnection
    OnUpdateError = tblJobTitleUpdateError
    OnDeleteError = tblJobTitleDeleteError
    OnEditError = tblJobTitleEditError
    OnPostError = tblJobTitlePostError
    Options.DefaultValues = True
    Left = 592
    Top = 8
  end
  object tblCountry: TUniTable
    TableName = 'dic_country'
    OrderFields = 'title'
    Connection = dmConnection
    OnUpdateError = tblCountryUpdateError
    OnDeleteError = tblCountryDeleteError
    OnEditError = tblCountryEditError
    OnPostError = tblCountryPostError
    Options.DefaultValues = True
    Left = 592
    Top = 64
    object tblCountryid: TIntegerField
      FieldName = 'id'
    end
    object tblCountrycode: TStringField
      FieldName = 'code'
      Required = True
      Size = 3
    end
    object tblCountrytitle: TStringField
      DisplayLabel = #1057#1090#1088#1072#1085#1072
      FieldName = 'title'
      Size = 100
    end
  end
  object tblRegion: TUniTable
    TableName = 'dic_region'
    OrderFields = 'country_id, title'
    Connection = dmConnection
    OnUpdateError = tblRegionUpdateError
    OnDeleteError = tblRegionDeleteError
    OnEditError = tblRegionEditError
    OnPostError = tblRegionPostError
    Options.DefaultValues = True
    Left = 648
    Top = 120
  end
  object dsCountry: TDataSource
    DataSet = tblCountry
    Left = 608
    Top = 80
  end
  object tblCurrency: TUniTable
    TableName = 'dic_currency'
    OrderFields = 'code, title'
    KeyFields = 'id'
    Connection = dmConnection
    OnUpdateError = tblCurrencyUpdateError
    OnDeleteError = tblCurrencyDeleteError
    OnEditError = tblCurrencyEditError
    OnPostError = tblCurrencyPostError
    Options.DefaultValues = True
    Left = 592
    Top = 168
  end
  object tblOfficeType: TUniTable
    TableName = 'office_type'
    OrderFields = 'id'
    KeyFields = 'id'
    Connection = dmConnection
    OnUpdateError = tblCurrencyUpdateError
    OnDeleteError = tblCurrencyDeleteError
    OnEditError = tblCurrencyEditError
    OnPostError = tblCurrencyPostError
    Options.DefaultValues = True
    Left = 520
    Top = 264
  end
  object dsJobTitle: TUniDataSource
    DataSet = tblJobTitle
    Left = 608
    Top = 24
  end
  object cxStyleRepository: TcxStyleRepository
    Left = 216
    Top = 128
    PixelsPerInch = 96
    object sGray: TcxStyle
      AssignedValues = [svFont, svTextColor]
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      TextColor = clGrayText
    end
    object sInactive: TcxStyle
      AssignedValues = [svColor]
      Color = 16704726
    end
    object sEven: TcxStyle
      AssignedValues = [svColor]
      Color = clWhite
    end
    object sOdd: TcxStyle
      AssignedValues = [svColor]
      Color = 16119290
    end
    object sSelection: TcxStyle
      AssignedValues = [svColor]
      Color = 15575446
    end
    object sPreview: TcxStyle
      AssignedValues = [svColor, svTextColor]
      Color = 15922164
      TextColor = clGray
    end
    object cxStyle1: TcxStyle
      AssignedValues = [svColor, svFont, svTextColor]
      Color = clWindow
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clRed
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      TextColor = clRed
    end
  end
  object tblEmpState: TUniTable
    TableName = 'emp_state'
    OrderFields = 'id'
    KeyFields = 'id'
    Connection = dmConnection
    OnUpdateError = tblEmpStateUpdateError
    OnDeleteError = tblEmpStateDeleteError
    OnEditError = tblEmpStateEditError
    Options.DefaultValues = True
    Left = 616
    Top = 280
  end
  object dsEmpState: TUniDataSource
    DataSet = tblEmpState
    Left = 632
    Top = 296
  end
  object dsCurrency: TUniDataSource
    DataSet = tblCurrency
    Left = 608
    Top = 184
  end
  object tblPriceListType: TUniTable
    TableName = 'price_list_type'
    OrderFields = 'title'
    KeyFields = 'id'
    Connection = dmConnection
    OnUpdateError = tblCurrencyUpdateError
    OnDeleteError = tblCurrencyDeleteError
    OnEditError = tblCurrencyEditError
    OnPostError = tblCurrencyPostError
    Options.DefaultValues = True
    Left = 544
    Top = 104
  end
  object dsPriceListType: TUniDataSource
    DataSet = tblPriceListType
    Left = 552
    Top = 120
  end
  object tblOrderState: TUniTable
    TableName = 'order_state'
    OrderFields = 'id'
    KeyFields = 'id'
    Connection = dmConnection
    OnUpdateError = tblEmpStateUpdateError
    OnDeleteError = tblEmpStateDeleteError
    OnEditError = tblEmpStateEditError
    Options.DefaultValues = True
    Left = 616
    Top = 368
  end
  object dsOrderState: TUniDataSource
    DataSet = tblOrderState
    Left = 632
    Top = 384
  end
  object tblClient: TUniTable
    TableName = 'client'
    Connection = dmConnection
    Left = 328
    Top = 16
  end
  object dsClient: TUniDataSource
    DataSet = tblClient
    Left = 336
    Top = 32
  end
  object quTemp: TUniQuery
    Connection = dmConnection
    Left = 176
    Top = 296
  end
  object tblPriceList: TUniTable
    TableName = 'price_list'
    OrderFields = 'id'
    KeyFields = 'id'
    Connection = dmConnection
    OnUpdateError = tblEmpStateUpdateError
    OnDeleteError = tblEmpStateDeleteError
    OnEditError = tblEmpStateEditError
    Options.DefaultValues = True
    Left = 432
    Top = 176
  end
  object dsPriceList: TUniDataSource
    DataSet = tblPriceList
    Left = 448
    Top = 192
  end
  object tblOrderListState: TUniTable
    TableName = 'order_list_state'
    OrderFields = 'id'
    KeyFields = 'id'
    Connection = dmConnection
    OnUpdateError = tblEmpStateUpdateError
    OnDeleteError = tblEmpStateDeleteError
    OnEditError = tblEmpStateEditError
    Options.DefaultValues = True
    Left = 424
    Top = 304
  end
  object dsOrderListState: TUniDataSource
    DataSet = tblOrderListState
    Left = 440
    Top = 320
  end
  object tblEmployee: TUniTable
    TableName = 'employee'
    OrderFields = 'name'
    Connection = dmConnection
    Filtered = True
    Filter = 'id <> 1'
    Left = 400
    Top = 16
  end
  object dsEmployee: TUniDataSource
    DataSet = tblEmployee
    Left = 408
    Top = 32
  end
  object tblMIOType: TUniTable
    TableName = 'money_in_out_type'
    OrderFields = 'id'
    KeyFields = 'id'
    Connection = dmConnection
    OnUpdateError = tblEmpStateUpdateError
    OnDeleteError = tblEmpStateDeleteError
    OnEditError = tblEmpStateEditError
    Options.DefaultValues = True
    Left = 304
    Top = 112
  end
  object dsMIOType: TUniDataSource
    DataSet = tblMIOType
    Left = 320
    Top = 128
  end
  object memPR: TdxMemData
    Indexes = <>
    SortOptions = []
    Left = 88
    Top = 192
    object memPRcode: TIntegerField
      FieldName = 'code'
    end
    object memPRtitle: TStringField
      FieldName = 'title'
    end
  end
  object dsPR: TUniDataSource
    DataSet = memPR
    Left = 96
    Top = 208
  end
  object prcCopyOrder: TUniStoredProc
    StoredProcName = 'CopyOrderOut'
    Connection = dmConnection
    Left = 72
    Top = 272
    ParamData = <
      item
        DataType = ftInteger
        Name = 'Result'
        ParamType = ptResult
      end
      item
        DataType = ftInteger
        Name = 'old_order_id'
        ParamType = ptInput
      end>
    CommandStoredProcName = 'CopyOrderOut'
  end
  object tblPPType: TUniTable
    TableName = 'pp_type'
    OrderFields = 'title'
    KeyFields = 'id'
    Connection = dmConnection
    OnUpdateError = tblCurrencyUpdateError
    OnDeleteError = tblCurrencyDeleteError
    OnEditError = tblCurrencyEditError
    OnPostError = tblCurrencyPostError
    Options.DefaultValues = True
    Left = 504
    Top = 376
  end
  object dsPPType: TUniDataSource
    DataSet = tblPPType
    Left = 512
    Top = 392
  end
  object memNB: TdxMemData
    Indexes = <>
    SortOptions = []
    Left = 152
    Top = 184
    object IntegerField1: TIntegerField
      FieldName = 'code'
    end
    object StringField1: TStringField
      FieldName = 'title'
    end
  end
  object dsNB: TUniDataSource
    DataSet = memNB
    Left = 160
    Top = 200
  end
  object prcNextPaymentNumber: TUniStoredProc
    StoredProcName = 'NextPaymentNumber'
    Connection = dmConnection
    Left = 72
    Top = 320
  end
  object memYesNo: TdxMemData
    Indexes = <>
    SortOptions = []
    Left = 232
    Top = 200
    object IntegerField2: TIntegerField
      FieldName = 'code'
    end
    object StringField2: TStringField
      FieldName = 'title'
    end
  end
  object dsYesNo: TUniDataSource
    DataSet = memYesNo
    Left = 240
    Top = 216
  end
  object prcNextOrderNumber: TUniStoredProc
    StoredProcName = 'NextOrderNumber'
    Connection = dmConnection
    Left = 72
    Top = 368
  end
  object quOrderNums: TUniQuery
    Connection = dmConnection
    SQL.Strings = (
      'select id, num from orders order by id')
    Left = 272
    Top = 296
  end
  object dsOrderNums: TUniDataSource
    DataSet = quOrderNums
    Left = 280
    Top = 320
  end
  object prcEnterPayment: TUniStoredProc
    StoredProcName = 'processpayments'
    Connection = dmConnection
    Left = 72
    Top = 416
    ParamData = <
      item
        DataType = ftInteger
        Name = 'p_paym_id'
        ParamType = ptInput
      end
      item
        DataType = ftString
        Name = 'p_act_list'
        ParamType = ptInput
        Size = 1000
      end
      item
        DataType = ftInteger
        Name = 'p_act_count'
        ParamType = ptInput
      end
      item
        DataType = ftSmallint
        Name = 'p_new'
        ParamType = ptInput
      end
      item
        DataType = ftInteger
        Name = 'p_result'
        ParamType = ptOutput
        Value = 1
      end>
    CommandStoredProcName = 'processpayments'
  end
  object prcUpdateActSum: TUniStoredProc
    StoredProcName = 'UpdateActSumm'
    Connection = dmConnection
    Left = 168
    Top = 416
    ParamData = <
      item
        DataType = ftInteger
        Name = 'p_order_id'
        ParamType = ptInput
      end>
    CommandStoredProcName = 'UpdateActSumm'
  end
  object prcPrepareForDelPaym: TUniStoredProc
    StoredProcName = 'PrepareForDeletePayment'
    Connection = dmConnection
    Left = 272
    Top = 400
    ParamData = <
      item
        DataType = ftInteger
        Name = 'p_paym_id'
        ParamType = ptInput
      end>
    CommandStoredProcName = 'PrepareForDeletePayment'
  end
  object uniDump: TUniDump
    OnError = uniDumpError
    Connection = dmConnection
    Left = 136
    Top = 80
  end
  object prcNextClientNumber: TUniStoredProc
    StoredProcName = 'NextClientNumber'
    Connection = dmConnection
    Left = 72
    Top = 480
  end
end
